package com.citywithincity.utils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CrossDomainUtil {
	static String crossDomain;
	static String header;
	static{
		crossDomain = ConfigReader.getDefault().get("cross_domain");
		header = ConfigReader.getDefault().get("cross_domain_header");
	}
	
	
	public static void checkAndSetCrossDomain(HttpServletRequest request,HttpServletResponse response){
		response.addHeader("Access-Control-Allow-Origin",crossDomain);
		response.addHeader("Access-Control-Allow-Credentials", "true");
		response.addHeader("Access-Control-Allow-Headers", header);
	}
	
}
